From 447a08c78932305352b8d00133a3325f8b81a0f0 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Mon, 6 Nov 2006 11:36:38 +0000 Subject: [PATCH] Catch IOError when using local configuration files, to give better diagnostics. Signed-off-by: Ewan Mellor --- tools/python/xen/xm/create.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py index 1bb5171eef..d94356d5c5 100644 --- a/tools/python/xen/xm/create.py +++ b/tools/python/xen/xm/create.py @@ -1200,7 +1200,10 @@ def main(argv): return if type(config) == str: + try: config = sxp.parse(file(config))[0] + except IOError, exn: + raise OptionError("Cannot read file %s: %s" % (config, exn[1])) if opts.vals.dryrun: PrettyPrint.prettyprint(config) -- 2.30.2